from typing import List, Set
from config import active_config

class DataValidator:
    """
    数据验证工具类，提供可复用的数据校验方法
    """
    @staticmethod
    def is_complete(venue: dict) -> bool:
        """校验场馆数据完整性"""
        return all(key in venue for key in active_config['required_keys'])

    @staticmethod
    def is_duplicate(name: str, seen_names: Set[str]) -> bool:
        """检查场馆名称是否重复"""
        return name in seen_names

    @classmethod
    def validate_venue(cls, venue: dict, seen_names: Set[str]) -> bool:
        """综合验证方法"""
        return cls.is_complete(venue) and \
               not cls.is_duplicate(venue['name'], seen_names)